<template>
  <div :class="$style.wrapper">
    <div style="display: flex">
      <ps-data-tag style="flex: 1;margin:10px "></ps-data-tag>
      <ps-data-tag style="flex: 1;margin:10px "></ps-data-tag>
      <ps-data-tag style="flex: 1;margin:10px "></ps-data-tag>
      <ps-data-tag style="flex: 1;margin:10px "></ps-data-tag>
    </div>
    <div :class="$style.unresolvedTask">
      <div :class="$style.title">待处理任务</div>
      <el-table :data="unresolvedTask" border>
        <el-table-column label="任务编号" prop="variables.ticket.ticketNumber">
          <template slot-scope="{row}">
            <span>{{ row.variables.ticket.ticketNumber || '未知' }}</span>
          </template>
        </el-table-column>
        <el-table-column label="产线" prop="variables.customerName"></el-table-column>
        <el-table-column label="设备信息" prop="variables.devName"></el-table-column>
        <el-table-column label="设备编码" prop="variables.deviceCode"></el-table-column>
        <el-table-column label="任务分类" prop="variables.appName"></el-table-column>
        <el-table-column label="报警信息" prop="variables.alertTitle"></el-table-column>
        <el-table-column label="报警级别" prop="variables.severity">
          <template slot-scope="{row}">
            <el-tag type="danger" v-if="row.variables.severity == 4">危险</el-tag>
            <el-tag type="warning" v-else-if="row.variables.severity == 3">警告</el-tag>
            <el-tag type="info" v-else-if="row.variables.severity == 2">注意</el-tag>
            <el-tag v-else>正常</el-tag>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script>
import api from './../../../common/js/api';
import PsDataTag from './../../../wugang/components/tag/PsDataTag.vue';

export default {
  name: 'IntelligentProductionLineEngineerIndex',
  components: {
    PsDataTag
  },
  data () {
    return {
      unresolvedTask: []
    };
  },
  mounted () {
    api.post('ticketTaskService.getTicketTasksByConditionAndPage', [{
      'taskStatus': 10,
      'categorys': '280',
      'ticketTaskStatus': 'dealing'
    }, { 'start': 0, 'length': 10 }]).then(ret => {
      this.unresolvedTask = ret.data.data;
    });
  }
};
</script>
<style lang="scss" module>
@import "./../../../style/wugang/production-engineer-index.scss";
</style>
